GdPicture image identifier.
Array of Integer. This parameter is used as a reference to the location of the OMR Fields. Where each quadruplet (left, top, width, height) corresponds to a rectangle surrounding a single OMR field. For example, if 40 entries exist in Areas, there will be 10 OMR Fields to be investigated whether they were checked (filled) or not.
Number of Rectangles sent to the method. Basically, the length of Areas().
How sensitive the method is to degree of filling of the OMR field in respect to the size of the field itself. Higher values will result in more tolerant results where semi filling of the field would yield positive results. Lower values will result in less tolerant results where maximum filling of the field only would yield positive results Sensitivity greatly affects the confidence value returned. Range from 0.0 to 1.0. If different values are entered, they will automatically be limited to this range. Default Value is 0.5.
Reference to a 1-Dimensional array of Integers. Must be initialized and sent to method. After the method is called, the array elements would correspond to the confidence of the result returned by the method. For Examples, if Confidence[0] = 40, then the first OMR field result returned is 40% accurate. It is important to mark that Confidence is greatly affected by "Sensitivity". Confidence value is a mixture of how much the sensitivity standard was accomplished, how much was it exceeded or unmet. It also details the respect of the filling to the size of the border and the regularity of the border.
Whether the OMR field contains a character inside it or not.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / OMRDetectOvalMarks Method / OMRDetectOvalMarks(Int32,Int32[],Int32,Double,Int32[],Boolean) Method

OMRDetectOvalMarks(Int32,Int32[],Int32,Double,Int32[],Boolean) Method

In This Topic
Returns whether a selected OMR (Optical Mark Recognition) field/s is filled or not, with Sensitivity Control and Confidence Level returned. This method is mainly used for Oval shaped Fields. An OMR field can be a checkbox, a fill-in-area checkbox, areas on a multiple choice examination form, or any area where highlighting is required to indicate a certain choice. This overload is for COM Interop purpose and takes an array of Integer for the Areas parameter.
Syntax
'Declaration
 
Public Overloads Function OMRDetectOvalMarks( _
   ByVal ImageID As Integer, _
   ByRef Areas() As Integer, _
   ByVal AreasCount As Integer, _
   ByVal Sensitivity As Double, _
   ByRef Confidence() As Integer, _
   ByVal HasCharacter As Boolean _
) As Integer()
public int[] OMRDetectOvalMarks( 
   int ImageID,
   ref int[] Areas,
   int AreasCount,
   double Sensitivity,
   ref int[] Confidence,
   bool HasCharacter
)
public function OMRDetectOvalMarks( 
    ImageID: Integer;
   var  Areas: Integerarray of;
    AreasCount: Integer;
    Sensitivity: Double;
   var  Confidence: Integerarray of;
    HasCharacter: Boolean
): array of Integer; 
public function OMRDetectOvalMarks( 
   ImageID : int,
   Areas : int[],
   AreasCount : int,
   Sensitivity : double,
   Confidence : int[],
   HasCharacter : boolean
) : int[];
public: int[]* OMRDetectOvalMarks( 
   int ImageID,
   ref int[]* Areas,
   int AreasCount,
   double Sensitivity,
   ref int[]* Confidence,
   bool HasCharacter
) 
public:
array<int>^ OMRDetectOvalMarks( 
   int ImageID,
   array<int>^% Areas,
   int AreasCount,
   double Sensitivity,
   array<int>^% Confidence,
   bool HasCharacter
) 

Parameters

ImageID
GdPicture image identifier.
Areas
Array of Integer. This parameter is used as a reference to the location of the OMR Fields. Where each quadruplet (left, top, width, height) corresponds to a rectangle surrounding a single OMR field. For example, if 40 entries exist in Areas, there will be 10 OMR Fields to be investigated whether they were checked (filled) or not.
AreasCount
Number of Rectangles sent to the method. Basically, the length of Areas().
Sensitivity
How sensitive the method is to degree of filling of the OMR field in respect to the size of the field itself. Higher values will result in more tolerant results where semi filling of the field would yield positive results. Lower values will result in less tolerant results where maximum filling of the field only would yield positive results Sensitivity greatly affects the confidence value returned. Range from 0.0 to 1.0. If different values are entered, they will automatically be limited to this range. Default Value is 0.5.
Confidence
Reference to a 1-Dimensional array of Integers. Must be initialized and sent to method. After the method is called, the array elements would correspond to the confidence of the result returned by the method. For Examples, if Confidence[0] = 40, then the first OMR field result returned is 40% accurate. It is important to mark that Confidence is greatly affected by "Sensitivity". Confidence value is a mixture of how much the sensitivity standard was accomplished, how much was it exceeded or unmet. It also details the respect of the filling to the size of the border and the regularity of the border.
HasCharacter
Whether the OMR field contains a character inside it or not.

Return Value

The method returns an Array of integers. If the value of an element is 0, then the field was not filled. If the value of an element is 1, then the field was filled. The Elements of the returned array will correspond to the Elements of the Rectangles Array Areas(). Where if the first element of the returned array[0] is 0, then the OMR field surrounded by the rectangle in the element of Areas[0] was not filled. Similarly, if the first element of the returned array[5] is 1, then the OMR field surrounded by the rectangle in the element of Areas[5] was filled.
Remarks

All Rectangles sent to the method via array Areas can be of any size or location, as long as they: 1. Surround the OMR Field completely. 2. Do not intersect with borders of OMR field. 3. Do not intersect with other objects in the document.

Closer, more accurate selection of those rectangles will yield faster and more accurate results.

"Sensitivity" affects the "Confidence" returned. Low Sensitivity would return high results of Confidence for empty fields, but low Confidence results for semi filled fields. High Sensitivity would return low results of Confidence for empty fields, but High Confidence results for semi filled fields. It is important to note that "Confidence" is the degree of confidence that sensitivity rules are met, and not the actual filling or not filling of the field. If sensitivity values do not correspond properly to the filling, the confidence would spell to the sensitivity value more than the actual filling or not filling of the field.

If many documents are scanned of the same form, and the scanning orientation or quality is not guaranteed, the GdPicture Anchoring System can be used to specify the orientation of each document and the translation made to each document from the one where the user selected their Areas (surrounding rectangles). Then you can manually change the rectangle arrays to each document via the data provided.

To obtain best and most accurate results, images have to be of good quality, at least 200 dpi is recommended.

This method is used in the "OMR" Demo.

This method requires the ADR & OMR component to run.

Example
Testing whether a selected OMR (Optical Mark Recognition) field/s is filled or not within a tiff.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.tif", false);
 
    const int markCount = 3;
    // Each mark uses a quadruplet for its location (left, top, width, height).
    int[] areas = new int[markCount * 4]
    {
        // First area left, top, width, height.
        850, 1580, 30, 30,
        // Second area left, top, width, height.
        850, 1620, 30, 30,
        // Third area left, top, width, height.
        850, 1660, 30, 30
    };
 
    int[] confidences = new int[markCount];
    int[] filled = gdpictureImaging.OMRDetectOvalMarks(imageID, ref areas, markCount, 0.5, ref confidences, false);
 
    StringBuilder result = new StringBuilder();
    for (int index = 0; index < markCount; index++)
    {
        result.AppendLine("Index:" + index.ToString());
        result.AppendLine("Left:" + areas[4 * index].ToString());
        result.AppendLine("Top:" + areas[4 * index + 1].ToString());
        result.AppendLine("Width:" + areas[4 * index + 2].ToString());
        result.AppendLine("Height:" + areas[4 * index + 3].ToString());
        result.AppendLine("Confidence:" + confidences[index].ToString());
        result.AppendLine("Filled:" + filled[index].ToString());
        result.AppendLine();
    }
 
    MessageBox.Show(result.ToString(), "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also